export function formateDate(val: string) {
  if (!val) {
    return "";
  }
  const addZero = (i: number) => {
    if (i < 10) {
      return "0" + i;
    }
    return i;
  };
  let date = new Date(val);
  let year = date.getFullYear();
  let month = addZero(date.getMonth() + 1);
  let day = addZero(date.getDate());
  let hours = addZero(date.getHours());
  let minutes = addZero(date.getMinutes());
  let seconds = addZero(date.getSeconds());
  return (
    year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
  );
}
